package niu.toy.spring.mvc;


import niu.toy.spring.ioc.annotation.Nullable;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 视图接口
 */
public interface View {
    @Nullable
    default String getContentType() {
        return "text/html;charset=UTF-8";
    }

    /**
     * 渲染视图
     */
    void render(@Nullable Map<String,Object> model, HttpServletRequest request, HttpServletResponse response)
            throws Exception;
}
